package cc.lucien.springboot01.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lucien-ma
 * @date 2021/9/12
 * @apiNote
 */
@RestController
@RequestMapping("/hello")
public class HelloHandler {

    /**
     * SpEL Spring Expression Language
     */
    @Value("${server.port}")
    private String port;

    @GetMapping("/index")
    public String index() {
        return "当前服务的端口是：" + this.port;
    }
}
